package com.andrewdashin.twit2jabber.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * User: dashin
 * Date: 02.12.2009
 * Time: 20:45:16
 */

@Entity(name = "user")
public class User implements Serializable {
    private String jabberUserName;
    private String twitterUserName;
    private String twitterPassword;
    private boolean active;
    private long lastTwit = 0L;

    public User() {
    }

    public User(String jabberUserName, String twitterUserName, String twitterPassword, boolean active, long lastTwit) {
        this.jabberUserName = jabberUserName;
        this.twitterUserName = twitterUserName;
        this.twitterPassword = twitterPassword;
        this.active = active;
        this.lastTwit = lastTwit;
    }

    @Id
    @Column(name = "jabber_user_name", nullable = false, unique = true, length = 255)
    public String getJabberUserName() {
        return jabberUserName;
    }

    public void setJabberUserName(String jabberUserName) {
        this.jabberUserName = jabberUserName;
    }

    @Column(name = "twitter_user_name", nullable = false, length = 255)
    public String getTwitterUserName() {
        return twitterUserName;
    }

    public void setTwitterUserName(String twitterUserName) {
        this.twitterUserName = twitterUserName;
    }

    @Column(name = "twitter_password", nullable = false, length = 255)
    public String getTwitterPassword() {
        return twitterPassword;
    }

    public void setTwitterPassword(String twitterPassword) {
        this.twitterPassword = twitterPassword;
    }

    @Column(name = "is_active", nullable = false)
    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    @Column(name = "last_twit", nullable = false)
    public long getLastTwit() {
        return lastTwit;
    }

    public void setLastTwit(long lastTwit) {
        this.lastTwit = lastTwit;
    }
}
